function formatTime(date) {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const week = date.getDay();
  const weekText = ['日', '一', '二', '三', '四', '五', '六'][week];

  const formattedYear = formatNumber(year);
  const formattedMonth = formatNumber(month);
  const formattedDay = formatNumber(day);
  return `${formattedYear}年${formattedMonth}月${formattedDay}日 星期${weekText}`
}
function formatNumber(n) {
  n = n.toString()
  return n[1] ? n : '0' + n
}


module.exports = {
  formatTime:formatTime
}
